%% -*- mode: erlang -*-
%% ex: ft=erlang
{sys, [
    {lib_dirs, ["../apps", "../deps"]},
    {erts, [{mod_cond, derived}, {app_file, strip}]},
    {app_file, strip},
    {rel, "mms", "1",
        [
            kernel,
            stdlib,
            sasl,
            cowboy,
            mms
        ]},
    {rel, "start_clean", "",
        [
            kernel,
            stdlib
        ]},
    {boot_rel, "mms"},
    {profile, embedded},
    {incl_cond, exclude},
    {excl_archive_filters, [".*"]}, %% Do not archive built libs
    {excl_sys_filters, ["^bin/(?!start_clean.boot)",
        "^erts.*/bin/(dialyzer|typer)",
        "^erts.*/(doc|info|include|lib|man|src)"]},
    {excl_app_filters, ["\.gitignore"]},
    {app, stdlib, [{incl_cond, include}]},
    {app, sasl, [{incl_cond, include}]},
    {app, ssl, [{incl_cond, include}]},
    {app, asn1, [{incl_cond, include}]},
    {app, inets, [{incl_cond, include}]},
    {app, kernel, [{incl_cond, include}]},
    {app, crypto, [{incl_cond, include}]},
    {app, public_key, [{incl_cond, include}]},
    {app, ranch, [{incl_cond, include}]},
    {app, cowlib, [{incl_cond, include}]},
    {app, cowboy, [{incl_cond, include}]},
    {app, jsx, [{incl_cond, include}]},
    {app, lhttpc, [{incl_cond, include}]},
    {app, meck, [{incl_cond, include}]},
    {app, mysql, [{incl_cond, include}]},
    {app, erlcloud, [{incl_cond, include}]},
    {app, eredis, [{incl_cond, include}]},
    {app, lager, [{incl_cond, include}]},
    {app, goldrush, [{incl_cond, include}]},
    {app, syntax_tools, [{incl_cond, include}]},
    {app, compiler, [{incl_cond, include}]},
    {app, mms, [{mod_cond, app}, {incl_cond, include}]}
]}.

{target_dir, "mms"}.

{overlay_vars, "vars.config"}.

{overlay, [
    {mkdir, "log/sasl"},
    {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
    {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
    {copy, "mms/bin/start_clean.boot",
        "\{\{erts_vsn\}\}/bin/start_clean.boot"},
    {copy, "files/mms", "bin/mms"},
    {copy, "files/mms.cmd", "bin/mms.cmd"},
    {copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
    {copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"},
    {template, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
    {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
]}.
